/*******************************************************************************
* @Filename      : bsp_lcd.h

* @Description   : bsp_lcd.h

* @Version       : 1.0.0

* @Date          : 2023.12.2
*******************************************************************************/

#ifndef __BSP_IMAGE_H
#define __BSP_IMAGE_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "bsp.h"

/**
 ** zhao add
 **/
#define GUI_ASSET_HEADER_MAGIC       0x5249// FM
#define GUI_ASSET_HEADER_VALID       0xA1

#define GUI_LCD_PIXEL_BYTES         (2)
#define PIC_LIB_INFO_SIZE           (12)

#define  WHITE  0xffff
#define  BLACK  0x0000
#define  RED    0xf800
#define  GREEN  0x07e0
#define  BLUE   0x001f
#define  GRAY   0xE3D3
#define  L_Green 0xA5CE // USE BATTRY ICON
#define  D_Green 0x0064  // 6400
#define  B_GRAY  0x39c7

typedef struct
{
    uint16_t magic;
    uint16_t version;
    uint32_t size;
    uint32_t crc32;
    uint8_t valid;
    uint8_t name[16];
    uint8_t datetime[14];
    uint8_t reserved[5];
}gui_asset_header_t;


typedef struct{
    uint8_t no;
    uint8_t type;
    uint8_t count;
    uint8_t bitcount;

    uint16_t w;
    uint16_t h;
    uint32_t address; 
}gui_assets_image_t;

//bool gui_image_assets_check_valid( void );

//void gui_image_assets_get_merge_header( gui_asset_header_t* header); 

int gui_assets_get_image(uint32_t index, uint16_t no, gui_assets_image_t * image); 

#define FLASH_BASE_ADDR                 (0)
#define GUI_PIC_RES_START_ADDRESS       (FLASH_BASE_ADDR)
#define GUI_PIC_RES_IMAGE_START_OFFSET (GUI_PIC_RES_START_ADDRESS + 0x30)
#define GUI_GET_IMAGE_START_ADDR()      (GUI_PIC_RES_START_ADDRESS)
#define GUI_GET_IMAGE_HEADER_ADDR()   (GUI_PIC_RES_START_ADDRESS)
#define GUI_GET_IMAGE_ADDR(x)       ( (x) + GUI_PIC_RES_IMAGE_START_OFFSET) 

#ifdef __cplusplus
}
#endif
#endif

/* End of File ---------------------------------------------------------------*/
